package org.tools.ui.renderer.grid
{
	import mx.controls.Label;
	import mx.core.IDataRenderer;
	
	import org.tools.ui.rule.IStateRendererRule;

	public class StateRenderer extends Label implements IDataRenderer
	{
		private var _field:String = 'state';
		
		public function StateRenderer()
		{
			super();
		}
		
		override public function get data():Object
		{
			return super.data;
		}
		
		override public function set data(value:Object):void
		{
			super.data= value;
			
			var tmp:String = value[this._field];
			
			if(tmp){
				if(tmp == '1'){
					this.text = "未回复"
				}else if(tmp == '2'){
					this.text = "已回复"
				}else{
					this.text = "";
				}
			}else{
				this.text = "";
			}
		}
		
		public function get field():String{
			return this._field;
		}
		
		public function set field(value:String):void{
			this._field = value;
		}
	}
}